<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <link rel="stylesheet" type="text/css" href="../css/bui/bui.css">
    <link rel="stylesheet" type="text/css" href="../css/api.css">
    <link rel="stylesheet" type="text/css" href="../css/main.css">
    <style media="screen">
        body {
            background-color: #0D0B35;
        }

        [v-cloak] {
            display: none;
        }

        .tab {
            height: 1.05rem;
            line-height: 1.05rem;
            width: 100%;
            display: flex;
            justify-content: center;
            font-size: 0.36rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
        }

        .switch {
            display: flex;
            padding: 0 0.3rem;
            justify-content: space-between;
            color: #00F0FF;
            align-items: baseline;
        }

        .switch-l {
            width: 2.7rem;
            justify-content: space-between;
            display: flex;
            align-items: baseline;
        }

        .switch-l .font {
            font-size: 0.3rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: rgba(0, 240, 255, 1);
        }

        .active {
            font-size: 0.48rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: rgba(0, 240, 255, 1);
            border-bottom: 1px solid #00F0FF;
        }

        .main {
            width: 100%;
            padding: 0 0.3rem;
            display: flex;
            justify-content: space-between;
            flex-direction: column;
            align-items: center;
        }

        .main .item {
            width: 100%;
            height: 2.65rem;
            padding: 0.3rem 0.2rem;
            background-color: #0B1D54;
            color: white;
            display: flex;
            justify-content: space-between;
            margin-top: 0.25rem;
        }

        .main .item .left {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .main .item .right {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: flex-end;
        }

        .title {
            font-size: 0.36rem;
            font-family: Source Han Sans CN;
            font-weight: bold;
            color: rgba(255, 255, 255, 1);
        }

        .num,
        .limit {
            font-size: 0.24rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
        }

        .num {
            padding-top: 0.2rem;
        }

        .item img {
            width: 1.23rem;
            height: 0.34rem;
        }

        .fontpri {
            font-size: 0.3rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
        }

        .price {
            font-size: 0.48rem;
            font-family: JDZhengHT;
            font-weight: 400;
            color: rgba(0, 240, 255, 1);
        }

        .btn {
            width: 1.3rem;
            height: 0.56rem;
            line-height: 0.56rem;
            background: rgba(12, 12, 51, 1);
            border: 1px solid rgba(0, 240, 255, 1);
            border-radius: 0.27rem;
            color: #00F0FF;
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="app" class="chat-page" v-cloak>
        <div class="bui-scroll">
            <div class="bui-scroll-head"></div>
            <div class="bui-scroll-main" style="background:transparent">
                <div class="tab">
                    钱包
                </div>
                <div class="switch">
                    <div class="switch-l">
                        <div :class="swite==true?'active':'font'" @click='swit(true)'>我要买
                        </div>
                        <div :class="swite==false?'active':'font'" @click='swit(false)'>我要卖
                        </div>
                    </div>
                    <div class="switch-r" @click=openbillDetail()>
                        订单
                    </div>
                </div>
                <div class="main data1" v-show='swite'>
                    <div class="item" v-for='item in list1'>
                        <div class="left">
                            <div class="title">BUY</div>
                            <div class="num">
                                数量{{item.num}}USDT
                            </div>
                            <div class="limit">
                                限量{{item.limit}}
                            </div>
                            <img src="../image/wallet/payway.png">
                        </div>
                        <div class="right">
                            <div class="fontpri">
                                单价
                            </div>
                            <div class="price">￥{{item.price}}</div>
                            <div class="btn" @click=openframe(true)>
                                购买
                            </div>
                        </div>
                    </div>
                </div>
                <div class="main data2" v-show='!swite'>
                    <div class="item" v-for='item in list2'>
                        <div class="left">
                            <div class="title">BUY</div>
                            <div class="num">
                                数量{{item.num}}USDT
                            </div>
                            <div class="limit">
                                限量{{item.limit}}
                            </div>
                            <img src="../image/wallet/payway.png">
                        </div>
                        <div class="right">
                            <div class="fontpri">
                                单价
                            </div>
                            <div class="price">￥{{item.price}}</div>
                            <div class="btn" @click=openframe(false)>
                                出售
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="../script/jquery.js"></script>
<script src="../script/bui.js"></script>
<script src="../script/vue.js"></script>
<!-- <script src="../script/common.js"></script> -->
<!-- <script src="../script/md5-min.js"></script> -->
<!-- <script src="../script/fastclick.js"></script> -->
<script src="../script/api/api.js"></script>

<script type="text/javascript">
    var _vue = '';
    apiready = function() {
        init_bui();
        // initBook();
        // listContact.hide();
        // openframe();

    }

    function init_bui() {
        _vue = new Vue({
            el: '#app',
            data: {
                swite: true,
                list1: [{
                    num: 400.00,
                    limit: '100.00-400.00',
                    price: 2689
                }, {
                    num: 400.00,
                    limit: '100.00-400.00',
                    price: 2689
                }, {
                    num: 400.00,
                    limit: '100.00-400.00',
                    price: 2689
                }, {
                    num: 400.00,
                    limit: '100.00-400.00',
                    price: 2689
                }, {
                    num: 400.00,
                    limit: '100.00-400.00',
                    price: 2689
                }],
                list2: [{
                    num: 400.00,
                    limit: '100.00-400.00',
                    price: 2689
                }],
            },
            mounted() {

            },
            methods: {
                swit(e) {
                    this.swite = e;
                },
                openframe(e) {
                    api.openFrame({
                        name: 'popup',
                        url: 'popup.html',
                        rect: {
                            x: 0,
                            y: api.winHeight - 320,
                            w: 'auto',
                            h: 320
                        },
                        pageParam: {
                          page: e
                        },
                        bounces: false,
                        // bgColor: 'transparent',
                    }, function(ret, err) {
                        if (ret) {
                            // console.log(ret)
                        }
                    });
                },
                openbillDetail() {
                  api.openWin({
                      name: 'billDetail',
                      url: './billDetail/index.html',
                      bounces: false,
                      pageParam: {
                          name: 'test'
                      },
                  }, function(ret, err) {
                      if (ret) {
                          // console.log(ret)
                      }
                  });
                }
            },
        });
        api.setCustomRefreshHeaderInfo({
            bgColor: '#0D0B35',
            image: {
                pull: 'widget://image/pullrefresh/pull.png',
                transform: [
                    'widget://image/pullrefresh/pull_end_image_frame_01.png',
                    'widget://image/pullrefresh/pull_end_image_frame_02.png',
                    'widget://image/pullrefresh/pull_end_image_frame_03.png',
                    'widget://image/pullrefresh/pull_end_image_frame_04.png',
                    'widget://image/pullrefresh/pull_end_image_frame_05.png'
                ],
                load: [
                    'widget://image/pullrefresh/refreshing_image_frame_01.png',
                    'widget://image/pullrefresh/refreshing_image_frame_02.png',
                    'widget://image/pullrefresh/refreshing_image_frame_03.png',
                    'widget://image/pullrefresh/refreshing_image_frame_04.png',
                    'widget://image/pullrefresh/refreshing_image_frame_05.png',
                    'widget://image/pullrefresh/refreshing_image_frame_06.png'
                ]
            }
        }, function() {
            //下拉刷新被触发，自动进入加载状态，使用 api.refreshHeaderLoadDone() 手动结束加载中状态
            setTimeout(function() {
                api.refreshHeaderLoadDone()
            }, 1000);
        });
    }
</script>

</html>
